import sys
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QApplication, QMainWindow, QLabel

class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()

        self.setWindowTitle("My App")
        self.label = QLabel("")
        self.setCentralWidget(self.label)

    def mousePressEvent(self, e):
        if e.button() == Qt.LeftButton:
            self.label.setText("mousePressEvent Left")
            print("mousePressEvent Left")
        
        if e.button() == Qt.MiddleButton:
            self.label.setText("mousePressEvent Middle")
            print("mousePressEvent Middle")

        if e.button() == Qt.RightButton:
            self.label.setText("mousePressEvent Right")
            print("mousePressEvent Right")

    def mouseReleaseEvent(self, e):
        if e.button() == Qt.LeftButton:
            self.label.setText("mouseReleaseEvent Left")
            print("mouseReleaseEvent Left")

        if e.button() == Qt.MiddleButton:
            self.label.setText("mouseReleaseEvent Middle")
            print("mouseReleaseEvent Middle")

        if e.button() == Qt.RightButton:
            self.label.setText("mouseReleaseEvent Right")
            print("mouseReleaseEvent Right")

    def mouseDoubleClickEvent(self, e):
         if e.button() == Qt.LeftButton:
            self.label.setText("mouseDoubleClickEvent Left")
            print("mouseDoubleClickEvent Left")

         if e.button() == Qt.MiddleButton:
            self.label.setText("mouseDoubleClickEvent Middle")
            print("mouseDoubleClickEvent Middle")

         if e.button() == Qt.RightButton:
            self.label.setText("mouseDoubleClickEvent Right")
            print("mouseDoubleClickEvent Right")

app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec_()